package cmd

import (
	"gitee.com/xuender/se"
	"github.com/spf13/cobra"
)

// nolint: gochecknoinits
func init() {
	filesCmd := &cobra.Command{
		Use:     "files",
		Short:   "索引文件列表",
		Long:    `列表索引文件，及文件包含的词数量`,
		Aliases: []string{"fs", "list"},
		Run: func(cmd *cobra.Command, args []string) {
			app := se.InitApp(se.NewContext(cmd))
			defer app.Close()

			app.Files()
		},
	}

	filesCmd.Flags().Uint("limit", 100, "显示条数")
	filesCmd.Flags().String("start", "", "起始文件")
	rootCmd.AddCommand(filesCmd)
}
